//
//  CollectionNormalCell.swift
//  StudyDY
//
//  Created by yinchangming on 2018/7/4.
//  Copyright © 2018年 yinchangming. All rights reserved.
//

import UIKit

class CollectionNormalCell: UICollectionViewCell {

    @IBOutlet weak var roomNameLabel: UILabel!
    @IBOutlet weak var onLineLabel: UIButton!
    @IBOutlet weak var nikeNameLabel: UILabel!
    @IBOutlet weak var roomImageView: UIImageView!
    var room:RoomList?{
        didSet{
            nikeNameLabel.text=room?.nickname
            var  person=""
            if(room!.online>=10000){
                person="\(Float(room!.online / 10000))万人在线"
            }else {
                  person="\(room!.online)人在线"
            }
            onLineLabel.setTitle(person, for: .normal)
            roomNameLabel.text=room!.room_name
//            roomImageView.kf.setImage(with: URL(string: (room?.vertical_src)!))
            ImageTools.showImage(image: roomImageView, url: URL(string: (room?.vertical_src)!)!)
        }
    }

}
